
package com.kugou.game.sdk.statistics;

import com.kugou.framework.http.RequestPackage;
import com.kugou.framework.utils.UrlEncodeUtil;
import com.kugou.game.sdk.utils.UrlWrapper;

import android.content.Context;

import java.util.HashMap;

/**
 * 描述:统计SDK的崩溃
 *
 * @author jerryliu
 * @since 2015年11月17日 下午2:36:18
 */
public class StatSdkCrashTask extends AbsStatisticsTask {
    private String errorStr;

    private int optype;

    public StatSdkCrashTask(Context context, String errorStr, int optype) {
        super(context);
        this.errorStr = errorStr;
        this.optype = optype;
    }

    @Override
    public void initParams(HashMap<String, String> params) {
        params.put("statid", StatCmd.CMD_SDK_CRASH + "");
        params.put("errorlog", UrlEncodeUtil.encode(errorStr, "utf-8"));
        params.put("optype", optype + "");
    }

    @Override
    public int getRequestType() {
        return RequestPackage.TYPE_POST;
    }

    @Override
    public String getUrl() {
        return UrlWrapper.STATICS_ONLINE_POST_URL + getCommonParams();
    }
}
